package com.smart.gui;

import java.awt.Font;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.EmptyBorder;

import com.jgoodies.forms.factories.FormFactory;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.RowSpec;
import com.smart.core.AppManager.DesiredEnum;

public class Describe_Target_Test_Environment_Part2 extends JFrame {

	/**
	 * 
	 */
	private static final long serialVersionUID = -8416194724635300715L;

	private JPanel contentPane;

	/**
	 * singleton pattern -- getInstance
	 */
	private static Describe_Target_Test_Environment_Part2 uniqueInstanceForm;

	public static synchronized Describe_Target_Test_Environment_Part2 getInstance() {
		if (uniqueInstanceForm == null) {
			try {
				uniqueInstanceForm = new Describe_Target_Test_Environment_Part2();
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		return uniqueInstanceForm;
	}

	/**
	 * Create the frame.
	 */
	public Describe_Target_Test_Environment_Part2() {
		ButtonHandler handler = new ButtonHandler(this);

		setTitle("Describe Target Test Environment Questionnaire -- Part 2");
		setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
		setBounds(25, 25, 677, 300);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(new FormLayout(new ColumnSpec[] {
				FormFactory.RELATED_GAP_COLSPEC, FormFactory.MIN_COLSPEC,
				FormFactory.RELATED_GAP_COLSPEC,
				ColumnSpec.decode("default:grow"),
				FormFactory.RELATED_GAP_COLSPEC, FormFactory.MIN_COLSPEC, },
				new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.MIN_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.MIN_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.MIN_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						RowSpec.decode("default:grow"),
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.MIN_ROWSPEC,
						FormFactory.RELATED_GAP_ROWSPEC,
						FormFactory.MIN_ROWSPEC, }));

		JLabel lblOwnership = new JLabel("Ownership");
		contentPane.add(lblOwnership, "4, 2");

		JLabel lblDesirable = new JLabel("Desirable?");
		contentPane.add(lblDesirable, "6, 2");

		JLabel label = new JLabel("1)");
		contentPane.add(label, "2, 4");

		JLabel lblWhoOwnsThe = new JLabel(
				"Who owns the target cloud environment?");
		contentPane.add(lblWhoOwnsThe, "4, 4, left, default");

		JComboBox<DesiredEnum> comboBox = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox.setName("comboBox");
		comboBox.setMaximumRowCount(DesiredEnum.values().length);
		comboBox.setEditable(false);
		comboBox.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox, "6, 4, fill, default");

		JScrollPane scrollPane = new JScrollPane();
		contentPane.add(scrollPane, "4, 6, 3, 1, fill, fill");

		JTextArea textArea = new JTextArea();
		textArea.setName("textArea");
		textArea.setRows(1);
		textArea.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea.setLineWrap(true);
		scrollPane.setViewportView(textArea);

		JLabel label_1 = new JLabel("2)");
		contentPane.add(label_1, "2, 8");

		JLabel lblIfAnExternal = new JLabel(
				"If an external organization, what current communication and collaboration exists?");
		contentPane.add(lblIfAnExternal, "4, 8, left, default");

		JComboBox<DesiredEnum> comboBox_1 = new JComboBox<DesiredEnum>(
				DesiredEnum.values());
		comboBox_1.setName("comboBox_1");
		comboBox_1.setMaximumRowCount(DesiredEnum.values().length);
		comboBox_1.setEditable(false);
		comboBox_1.setSelectedItem(DesiredEnum.UNK);
		contentPane.add(comboBox_1, "6, 8, fill, default");

		JScrollPane scrollPane_1 = new JScrollPane();
		contentPane.add(scrollPane_1, "4, 10, 3, 1, fill, fill");

		JTextArea textArea_1 = new JTextArea();
		textArea_1.setName("textArea_1");
		textArea_1.setRows(1);
		textArea_1.setFont(new Font("Monospaced", Font.PLAIN, 11));
		textArea_1.setLineWrap(true);
		scrollPane_1.setViewportView(textArea_1);

		JButton btnSave = new JButton("Save");
		btnSave.setActionCommand(ButtonHandler.SAVE);
		btnSave.addActionListener(handler);
		contentPane.add(btnSave, "1, 12, 6, 1");
	}

}
